import React, { Component } from 'react';
import {
    StyleSheet,
    View,
    Text,
    ScrollView
} from 'react-native';
import styles from "./styles";
import TabItem from "./TabItem";

export default class ListTab extends Component {

    constructor(props) {
        super(props);
        this.state = {
            
        };
    }
    
    render() {
        const {fieldData, onTabClick, curIdx} = this.props;
        return (
            <View style={styles.tabContainer}>
                <ScrollView
                    showsVerticalScrollIndicator={true}
                    horizontal={true}
                >
                    {
                        fieldData.map((item,index) => {
                            return (
                                <TabItem
                                    data={item}
                                    onTabClick={onTabClick}
                                    curIdx={curIdx}
                                    styles={styles}
                                    key={index}
                                />
                            )
                        })
                    }
                </ScrollView>
            </View>
        );
    }
    
}

